//
//  VideoModel.m
//  JKXML
//
//  Created by 王冲 on 2019/1/25.
//  Copyright © 2019年 JK科技有限公司. All rights reserved.
//

#import "VideoModel.h"

@implementation VideoModel

-(NSString *)time
{
    int len = self.length.intValue;
    //时分秒
    return [NSString stringWithFormat:@"%02d:%02d:%02d",len/3600,(len%3600)/60,(len%60)];
}

-(instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+(instancetype)videoWithDict:(NSDictionary *)dict
{
    return [[self alloc]initWithDict:dict];
}

-(NSString *)description
{
    return [NSString stringWithFormat:@"<%@:%p>{videoId:%@,name:%@,length:%@,videoURL:%@,imageURL:%@,desc:%@,teacher:%@}",[self class],self,self.videoId,self.name,self.length,self.videoURL,self.imageURL,self.desc,self.teacher];
}

@end
